package com.googlecode.openrtp.grizzly.rtp.filter;

import com.googlecode.openrtp.spi.RtpSession;
import com.googlecode.openrtp.spi.annotation.Priority;
import java.io.IOException;
import java.util.logging.Logger;
import org.glassfish.grizzly.filterchain.BaseFilter;
import org.glassfish.grizzly.filterchain.FilterChainContext;
import org.glassfish.grizzly.filterchain.NextAction;
import org.glassfish.grizzly.memory.CompositeBuffer;

/**
 *
 * @author jocke
 */
@Priority(intValue = 300)
public class MpegAudioPacketizerFilter extends BaseFilter {

    private static final Logger LOG = Logger.getLogger(MpegAudioPacketizerFilter.class.getName());

    @Override
    public NextAction handleWrite(FilterChainContext ctx) throws IOException {
      
        CompositeBuffer buffer = ctx.getMessage();
        
        buffer.putInt(0);

        return super.handleWrite(ctx);
    }

    @Override
    public NextAction handleRead(FilterChainContext ctx) throws IOException {

        return super.handleWrite(ctx);
    }

}
